package java3_28;

import java.util.*;

/**
 *5：在List中放入若干整数，比如10个，然后删除其中的偶数。最后输出这个List
 */
public class ListDigital {
    public static void main(String[] args) {
        ArrayList li = new ArrayList();
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 10; i++) {
            System.out.println("请输入一个整数：");
            int x = scanner.nextInt();
            li.add(x);
        }
        for (int i = li.size()-1; i>0; i--) {
            int y = (int) li.get(i);
            if (y%2==0){
                li.remove(i);
            }
        }
        System.out.println(li);
    }
}
